import React, { Component } from 'react';
import {View, Text} from '@tarojs/components'
import './price-label.scss'

export default class PriceLabel extends Component<{ title: string; price: number; marketPrice: number; showMark: boolean }> {
  static defaultProps = {
    title: '优惠价',
    price: 0,
    marketPrice: 0,
    showMark: false
  }

  render() {
    return (
      <View className="priceLabel">
        <View className="title-box">{this.props.title}</View>
        <View className="price">¥ {this.props.price} {this.props.showMark &&
        <Text className='mark-price'>¥{this.props.marketPrice}</Text>}</View>
      </View>
    )
  }
}
